package com.zer0.tga.tile;

import com.zer0.tga.art.ArtArchive;
import com.zer0.tga.art.Bitmap;
import com.zer0.tga.art.Screen;
import com.zer0.tga.entity.Entity;
import com.zer0.tga.level.Level;
import com.zer0.tga.math.Direction;

public class WallTile extends Tile {
	
	public int walltype;
	
	
	   public void init(Level level, int x, int y) {
	        super.init(level, x, y);
	//        this.side = 0;
	    }
	   
	   public void init(Level level, int x, int y, int walltype) {
	        super.init(level, x, y);
	        this.walltype = walltype;
	    }
	   
	   public void setSide(Direction dir)
	   {
		   walltype = 0;
		   
		   if(dir == Direction.NORTH) walltype = 2;
		   else if(dir == Direction.SOUTH) walltype = 3;
		   else if(dir == Direction.EAST) walltype = 1;
		   else if(dir == Direction.WEST) walltype = 0;
		   
	   }

	public boolean canPass(Entity e) {
        return false;
    }

	public void render(Screen screen) 
	{
		super.render(screen);
		Bitmap bmp = ArtArchive.wallTile[0][walltype];
		screen.draw(bmp, position.x * Tile.WIDTH, position.y * Tile.HEIGHT); /*RandNum.getRandNum(0, 1)*/
    }
	
	public void render2(Screen screen)
	{
		super.render2(screen);
	    Bitmap bmp2 = ArtArchive.wallTile[1][walltype];
	    screen.draw(bmp2, position.x * Tile.WIDTH, (position.y-1)* Tile.HEIGHT);
	}

	
}
